package ws.performancetest.api;

import java.lang.reflect.Method;
import ws.performancetest.api.annotation.PerformanceTest;

/**
 *
 * @author Wilson Santos, 36228 <wilson.santos@ua.pt>
 */
public class Test {

  private final Method method;

  public Test(Method method) {
    this.method = method;
  }

  public Method unwrap() {
    return method;
  }

  @Override
  public String toString() {
    PerformanceTest annotation = method.getAnnotation(PerformanceTest.class);

    return annotation.name().equals("N/A") ? method.getName() : annotation.name();
  }
}
